<template>
    <div>
        <button>{{ left }}</button>
        <!-- navbar---{{ myTitle }} -->
        navbae---{{ computedTitle }}
        <button>{{ right }}</button>
        <!-- 测试子组件是否可以修改父组件传来的属性值：不可以,报错 -->
        <button @click="handleClick">修改父组件传来的属性值</button>
    </div>
</template>

<script>

export default {
    props: ["myTitle", "left", "right"],

    methods: {
        handleClick() {
            // console.log(222);
            this.myTitle = "666"
        }
    },
    computed: {
        computedTitle() {
            return this.myTitle + "---用计算属性修改父传子的属性值"
        }
    }
}

</script>